using System;
using System.Collections.Generic;
using TM.Data.ViewModels.VmMapper;

namespace TM.Data
{
    public static class VmMapperFactories
    {
        private static IDictionary<Type, object> Mappers()
        {
            return new Dictionary<Type, object>()
                       {
                           {typeof(IVmMapper), new VmMapper()}
                       };

        }

        public static IDictionary<Type, object> Mappers(IIoCParams ioCParams)
        {
            return new Dictionary<Type, object>()
                       {
                           {typeof(IVmMapper), new VmMapper(ioCParams)}
                       };

        }
        
        public static IVmMapper GetMapper<T>() where T : class
        {

            return Mappers()[typeof (T)] as IVmMapper;

        }
    }
}